﻿using OnWork.DataCenter.DAL.Common;
using SqlSugar;

namespace OnWork.DataCenter.DAL.DataCenter
{
    /// <summary>
    /// MQTT主题配置
    /// </summary>
    public class DSMqttTopic : BaseEntity
    {
        /// <summary>
        /// 主题连接名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 订阅的主题
        /// </summary>
        public string Topic { get; set; }

        /// <summary>
        /// 是否启用 默认不启用
        /// </summary>
        public bool Enable { get; set; } = false;

        /// <summary>
        /// MQTT配置的ID
        /// </summary>
        public long MqttID { get; set; }

        /// <summary>
        /// 关联MQTT配置里的对象
        /// </summary>
        [Navigate(NavigateType.ManyToOne, nameof(MqttID))]//一对一 SchoolId是StudentA类里面的
        public DSMqtt Mqtt { get; set; } //不能赋值只能是null

    }
}